            BCPROG v1.01 - ELECTRA BEARCAT 101 SWITCH CODE GENERATOR
                Copyright (C) 2003 by Ken Harris / CMI Software

ͻ  FEBRUARY, 2003: Thanks to the generosity of a user on the Strong
 HISTORY   Signals web site, I recently acquired a beautiful old fully- 
ͼ  functional Electra Bearcat 101 scanner.  Upon browsing the manual
and reading about the encoding scheme for programming frequencies which aren't
listed in the guide - and there are a LOT of them! - I realized that writing a
code generator program would be more or less a trivial exercise, not to mention
that such an encoder would be very useful to any Bearcat 101 owner.  The result
is this program.

September 27th, 2003: v1.00 released.

September 28th, 2003: v1.01 released [yes, just one day later <blush>].  Main-
tenance release; patched a few minor and esoteric bugs in the user interface,
and tweaked up a few small bits of code.  None of these patches affected the
switch code generation algorithms.

ͻ  I have been told that some other BC101 code gene-
 WHY YOU CAN TRUST BCPROG   rators can tend to exhibit inaccuracies, most
ͼ  often due to round-off errors, which can cause
them to generate incorrect results for certain frequencies.  [I can't and won't
name any of them, because I honestly don't know which ones they are.]  Extensive
testing of BCPROG by myself and others, in addition to comparisons between
BCPROG's results and Electra's frequency guide, have so far shown that BCPROG
does not exhibit any such tendencies, and I have full confidence that its
results are authoritative and accurate.  I don't think I'm exaggerating when I
say that this encoder is the best one available.

Aside from all that, the program double-checks its own results to make sure that
the sequences it generates can be accurately converted back to the target
frequencies, and the code generation function also monitors itself.  As such,
BCPROG always knows exactly which frequency is represented by any given switch
sequence, and if that frequency does not match your input, it will tell you.
[This validation function, the ability to turn a switch sequence into a
frequency, also forms the basis of BCPROG's "reverse lookup" feature; details
below.]

ͻ  This program is a DOS-native application and should 
 SYSTEM REQUIREMENTS   work even on machines as old as 8088-based XT's.  There 
ͼ  are no particular system requirements other than about
95K available RAM and the ability to run DOS applications.  As for myself, I am
running Win98SE.

BCPROG IS INTENDED FOR USE ONLY WITH THE ELECTRA BEARCAT 101 SCANNER.  I have it
on good authority that the encoding system used by the BC101 was unique to that
scanner.

                    

                 *   M A I N   S C R E E N   E X A M P L E   *

       ͻ
          F1 for help  ALT+X to exit  Switch 16 enables scan delay   
       Ķ
                                                         
                                                         
           1   2   3   4   5   6   7   8   9  10  11  12  13  14  15   
         ĿĿĿĿĿĿĿĿĿĿĿĿĿĿĿ  
             ߳߳߳    ߳߳        ߳߳  
         ܳܳ      ܳܳ    ܳܳܳܳ      
           
                                                                       
                                              
                                                    
                                                              
                                                       
          LogFile: ON               Enter Frequency:          MHz      
                                                                       
       ͹
                    Bearcat 101 Switch Code Generator v1.01            
                Copyright (C) 2003 by Ken Harris / CMI Software        
       ͼ

The above ASCII graphic is a plain representation of this code generator's
color graphic display.  Next to the "Enter Frequency:" prompt will be an input
box where you enter the frequency to be encoded [details below].  If your entry
is presumed to be acceptable by the Bearcat 101, then the program will display
the code sequence graphically in switches and lights, and the large "LED"
display below that will show the last valid frequency entered.  That's really
all there is to it!  [Of course, the BC101 does not actually light up the LED's
above the switches while it's being programmed; I just did that to spice up the
graphics a bit.  In reality, only the channel being programmed is lit.]

The program will not accept more than eight characters [digits and a decimal
point], which are all that is necessary for entering the highest frequency which
can be programmed into the BC101.  Invalid input will be rejected.

Trailing decimals may be omitted for "whole number" frequencies.  35.0000 MHz,
for instance, may be entered simply as 35, and the program will assume that you
mean 35 MHz and that you want it to add the decimal and trailing zeros.  It is
not necessary to enter all four decimal places - for instance, 42.6600 MHz may
be entered simply as 42.66.

It is important to note that the BC101's encoding scheme causes certain entries
to be rounded to the nearest valid frequency according to its internal band
plan.  The step size is 5 kHz in the low and middle bands, and 12.5 kHz in the
high band.  Frequencies which do not fall directly onto these step sizes are
rounded to the nearest valid frequency.  BCPROG makes these adjustments auto-
matically.  You may find that two different frequencies, if they are very near
each other - i.e., spaced closer together than the BC101's step sizes dictate
for the band in question - may cause the same switch sequences to be generated.
This should NOT be considered a bug in the program, but rather, just the way the
Bearcat 101 works.  Two words: "Whole numbers."  You veteran BC101 owners will
know what I mean.

Any entered frequency which does not exactly fit the BC101's band plan and
frequency spacing will cause the actual frequency - the nearest valid frequency,
the one which truly and directly corresponds to the resulting switch sequence -
to be displayed above it.  Such results can be authenticated via BCPROG's
reverse lookup feature.

While the BC101 actually has 16 switches for programming, only the first 15 are
displayed by this program.  Switch 16, when UP, is used to enable scan delay for
the selected frequency - it is not used for frequency generation.  Switches 14
and 15 are used to select one of three band ranges - UP/UP for the low band,
DOWN/UP for the middle band, and UP/DOWN for the high band.

This uses only three of the four possible permutations for these two switches; I
would assume that the DOWN/DOWN combination probably does nothing, aside perhaps
from causing the programming operation to fail.  I have not personally experi-
mented with this, and could not realistically do so without the proper testing
equipment [such as a frequency counter], but it is highly unlikely that a
DOWN/DOWN setting for switches 14 and 15 would magically access a hidden band
not documented by Electra.  At the very least, I have never seen any mention of
this while searching the web for BC101 information, and since this scanner was
introduced in 1975, I would assume that any such hidden band would have been
discovered and documented long before now.

                    

While running the program, you may press F1 to display a help screen [not that
much help is required for this program].  If an invalid frequency is entered -
improperly formatted or one which cannot be encoded - the program will display a
pop-up error message which lists the acceptable ranges.

The ALT+L key will toggle the logfile on or off.  When logging is ON, all valid
frequencies entered will be written to the logfile, along with their switch
sequences.  The logfile's name is BCPROG.LOG in the current directory.

Logging is OFF by default when the program is started; however, you may use the
/LOG command line option [run BCPROG.EXE /LOG] to automatically enable logging.
BCPROG also maintains a list of your 16 channels' programming; see "Master
Programming List" below.

ALT+X will close the program.

                    

Now, as for the frequency ranges...  Electra's manual for the Bearcat 101 listed
the valid ranges as being 30-50 MHz, 146-174 MHz, and 416-512 MHz.  According to
other BC101 owners, and to research I have done on the web, it appears that
perhaps a much wider range of frequencies may be programmed.  However, other
BC101 owners warn that receive sensitivity outside of the published bands may
not be very good at all.

It seems that the range of programmable frequencies - or, more accurately, the
range of frequencies which MAY be programmable IF all possible switch combi-
nations equate to frequencies which the BC101 can synthesize - may be more like
10.7450 to 51.7000 MHz, 143.7450 to 184.7000 MHz, and 409.6625 to 512.0500 MHz.

                ͸
                       PUBLISHED            THEORETICAL     
                  30.0000 to  50.0000   10.7450 to  51.7000 
                 146.0000 to 174.0000  143.7450 to 184.7000 
                 416.0000 to 512.0000  409.6625 to 512.0500 
                ;

These theoretical ranges can be verified using the reverse lookup - when
switches 1 through 13 are all UP, this is the LOWER limit of the selected band.
When they are all DOWN, this is the UPPER limit of the selected band.

This program will accept, and generate switch sequences for, any frequency
within the above theoretical limits.  I cannot and will not guarantee that your
BC101 can actually synthesize and receive frequencies outside of the band limits
published by Electra.  But, assuming these frequencies can in fact be programmed
and received, this code generator will show you which switches to set for them.
Please don't consider me an expert on the workings of this scanner - if you have
any technical questions, please try asking someone who knows a lot more about
the BC101 than I do.  The Strong Signals web site [www.strongsignals.net] is a
great place to start.

At any rate, the BC101's frequency guide lists only a portion of the frequencies
which MAY be possible.  For instance, note from above that the actual lower
limit of the low band MIGHT be around 10.7450 MHz [all switches in the UP
position].  That's a long way below the published 30 MHz limit as stated in the
manual!  If the BC101 really is capable of this kind of coverage, then it would
receive a grand total of 24,576 frequencies [8,192 in each of its three bands].

Note, however, that the BC101 is an FM-only scanner, and most of the activity in
the bands below 30 MHz will tend to be AM, CW [morse], and SSB [sideband].  In
addition, receive sensitivity is very likely to decrease significantly as the
frequency moves farther and farther away from the edges of the published bands,
especially in the low band, where the difference between the published and
theoretical lower limits is nearly 20 MHz.  Don't be surprised if you can't
receive anything clearly on these low frequencies, if anything at all.

It is beyond the scope of this manual to explain the algorithms for encoding
switch sequences.  Such information is readily available on the web; doing a
Google search on the phrase "bearcat 101" will most likely find the information
you need.  In most cases, what you will often find usually was copied verbatim
directly from the original BC101 manual.

As for programming frequencies into the BC101, that information is also readily
available on the web - also usually a verbatim copy from the original manual -
but here is a short primer.

First, set all 16 channel switches and the READY switch to the DOWN position.
The READY indicator should light.

Then, press down on the SCAN/MANUAL switch to step through the channels until
you have selected the channel number you wish to program.  The LED above the
channel number will indicate the selected channel.

Set all switches indicated by BCPROG for the desired frequency to the UP
position - remember that switch 16 enables scan delay for the channel being
programmed, so whether you set it on or not is purely a matter of preference -
then press down the ENTER switch.  The LED above the selected channel number
should go out for about a second, then come back on; this indicates successful
programming of that channel.

After you have finished programming your channels, set the READY switch back to
the UP position.

                    

                          R E V E R S E   L O O K U P

The "reverse lookup" feature - accessed via the ALT+R key from the main screen -
is something I added to this program mainly just because I could, but also
because I thought it might have the potential to be useful to somebody.  At the
very least, it can be an amusing toy.  This feature will allow you to select a
switch sequence and have the program automatically display the frequency which
corresponds to it.

It is worth noting that one of the core functions of the reverse lookup feature,
the function which converts a switch sequence back to a frequency, is also used
by other parts of the program for verification of switch sequence results.  This
allows BCPROG to monitor itself and ensure the accuracy of its results.

Operation of the reverse lookup feature is very simple - when ALT+R is pressed
at the main screen, the program will draw a double red box around the first
switch, and the main screen will indicate that you have entered the reverse
lookup mode.  This is your starting point.  The spacebar toggles switches up or
down, and the LEFT/RIGHT arrow keys let you move the double red box left or
right to select another switch.  Any changes will automatically update the large
LED frequency display below the switches.  The ESC key will exit the reverse
lookup and return you to the main screen.

While using the reverse lookup, keep in mind that the only valid selections for
switches 14 and 15 - which are used by the BC101 for band selection - are UP/UP
for the low band, DOWN/UP for the middle band, and UP/DOWN for the high band.
If both of these switches are set DOWN - which apparently does not correspond to
any known band selection - then the reverse lookup will display the frequency as
000.0000 regardless of how switches 1 through 13 are currently set.

FREQUENCIES SELECTED VIA THE REVERSE LOOKUP ARE NOT WRITTEN TO BCPROG.LOG.
However, they can be saved to BCPROG.INI with the CTRL+S key [see below], as the
most recent frequency selected is not cleared when you exit the reverse lookup.

                    

             T H E   M A S T E R   P R O G R A M M I N G   L I S T

BCPROG can save entered frequencies to a data file [BCPROG.INI] and use that
file to generate a sort of master programming chart in plain ASCII text, which
can be VERY useful for keeping track of the frequencies you have programmed into
your BC101.  This chart will list the channel numbers, assigned alpha tags [you
will be prompted to enter these; more below], and correct sequences for switches
1 to 15.  [Switch #16 enables scan delay for the channel being programmed;
whether you turn it on or not is your choice.]

The master programming list is AUTOMATICALLY GENERATED under the filename
BCPRSET.TXT; you do not need to press any keys to force BCPROG to generate this
file while the program is running.  You can, however, manually force the gene-
ration of BCPRSET.TXT from the DOS command prompt by running BCPROG with the
/COMPILE command line option - details below.

Note that BCPRSET.TXT is a different file than the optional BCPROG.LOG file.
BCPRSET.TXT is a chart specifically detailing your chosen programming for your
16 channels - a printout of this file is what you will want to have in front of
you while you are programming your BC101.  It also serves as a great form of
future reference.

After you enter a frequency into BCPROG, press CTRL+S to save that frequency.
You will be prompted for the channel number [1-16] in which to store it.
Entering 0 will cancel the save operation.  If you select a channel which
already contains a frequency, you will be asked whether you wish to replace it
with the new frequency.

After selecting the channel, you may enter a short description [alpha tag] for
that frequency.  BCPROG.INI and BCPRSET.TXT will be updated automatically.
Repeat this process for all of the frequencies you wish to program, then exit
BCPROG.  You may then display or print the BCPRSET.TXT file, which will show all
of the proper switch sequences for programming your BC101.

The CTRL+P key at the main screen will enable you to view your current pro-
gramming as saved in the BCPROG.INI file.  There are two such list screens
available; the LEFT/RIGHT arrow keys will toggle between them.  The first screen
lists the channel numbers, frequencies, and alpha tags, while the second screen
shows the switch sequences instead of the alpha tags.

The BCPROG.INI file is plain ASCII text and can be edited.  Note, however, that
you must always save it as plain text - if it is saved in any other format such
as .DOC or .WRI, it cannot be read by BCPROG and will be replaced by BCPROG
while the program initializes.

The format of BCPROG.INI is as follows: The file must start with a line which
reads [BCPROG] to indicate the start of your settings, and below that, there are
16 lines for your programming.  Example:

[BCPROG]
CHAN="1" FREQ="146.7000" TAG="KD6HDX Repeater"

As you can see, each line of programming has a field for the channel number
[indicated by CHAN=], a frequency [indicated by FREQ=], and an optional alpha
tag [indicated by TAG=].  The values for each field must be enclosed in quotes;
i.e., FREQ="146.7000" instead of FREQ=146.7000.  Any line which cannot be parsed
by BCPROG, as well as all blank lines and comments, will be discarded.

Since the BC101 has only 16 channels, only numbers from 1 to 16 are valid for
the CHAN= settings.

The FREQ= settings must be for frequencies which are within the BC101's range;
invalid or out-of-range entries will cause the entire line to be discarded.
BCPROG will accept all frequencies within the theoretical ranges listed above.

The TAG= settings may be empty [no text between the quotes], but they must still
be present - any line which is missing any of these three fields will be
discarded.  The contents of the TAG= settings can be up to 50 characters of
alphanumeric text; anything longer than 50 characters will be truncated.

You may enter these three fields in any order; however, BCPROG will always write
them in the CHAN/FREQ/TAG order shown above.  Also, you may rearrange your
channels simply by changing the values which follow CHAN=, and BCPROG will put
them in proper numeric order for you.

YOU WILL NOT NEED TO CREATE BCPROG.INI BEFORE RUNNING THE PROGRAM.  It will be
automatically created for you.  You may still create it beforehand if you wish -
it's just not necessary.

The /COMPILE command line option [run BCPROG.EXE /COMPILE] will force BCPROG to
read the BCPROG.INI file and generate the BCPRSET.TXT master programming chart
based on the contents of BCPROG.INI.  Note that the /COMPILE option will also
cause BCPROG to exit immediately after it finishes generating BCPRSET.TXT.  This
option is essentially a shortcut which enables you to generate a new BCPRSET.TXT
file after manually editing BCPROG.INI without your having to load and manually
exit from BCPROG.  Remember, though, that BCPROG still automatically updates
BCPRSET.TXT whenever it is run and whenever you save any frequencies with the
CTRL+S key.

Since the /COMPILE option forces the program to exit after generating the
BCPRSET.TXT file, all other command line options [such as /LOG] will be ignored
when /COMPILE is used.

                    

Please be sure to inform me if you discover any bugs in this program - detail
the exact circumstances under which the bug occurred if you can, particularly if
you are able to consistently reproduce it.  The code itself is relatively
simple, and my testing has shown that its results match what is listed in my
copy of the BC101's original frequency guide - not to mention that the program
automatically self-verifies its results - so I don't really expect any major
malfunctions.  Comments, questions, suggestions, and bug reports may be sent to
xfire905@aol.com.

When e-mailing me, please make make sure the subject of your mail is something
that I am not likely to discard as spam!  I tend to dump [delete, kill, ignore,
get rid of, not read] mail from unknown senders unless the subject clearly shows
that the mail is one that I will want to read.  Something like "hey" would not
really be a particularly good subject, but "BCPROG bug report" would definitely
get my attention.

This program is being distributed free of charge; however, I won't refuse
donations if they are offered.  E-mail me at the address above if you would like
to make a donation.

                    

This program is copyright (C) 2003 by Ken Harris / CMI Software.  Users may
freely copy and distribute this program to others, provided it is kept in its
original and unmodified form, including this documentation.  No fees may be
charged for distribution.  Users may not modify, decompile, or reverse-engineer
this program.  All applicable domestic [United States] and international rights
remain the exclusive property of the author; the author does not claim any
rights to which he is not legally entitled.

BCPROG is written in Microsoft BASIC v7.1 [PDS].  GUI display routines are
property of CMI Software.  Documentation and GUI screens are created using
TheDraw [property of TheSoft] and QEdit [property of SemWare].

Kudos to Rich Wells N2MCA, operator of the Strong Signals web site, and to its
many knowledgeable users.  Many thanks as well to "T.P." for the fine, fun, and
free vintage scanner!
